CC=g++
CFLAG=-Wall -Wextra -pedantic -ansi -Wmissing-declarations -Werror -g
SRC=$(wildcard *.cpp)
OBJ=$(SRC:.cpp=.o)
SRC_TEMP=$(wildcard *.tpp)
OBJ_TEMP=$(SRC_TEMP:%.tpp=../src/%.hpp)

EXEC=test

all:$(OBJ)
	cd Listen_Connexion && make
	cd Send_Message && make
	cd Get_Logkey && make
	mkdir -p ../bin;
	cd ../obj && $(CC) $(CFLAG) -o ../bin/$(EXEC) $^ $(OBJ_TEMP)

%.o:%.cpp
	mkdir -p ../obj;
	$(CC) $(CFLAG) -c -o ../obj/$@ $<

clean:
	rm -rf *~ \#*#
	cd Listen_Connexion && make clean
	cd Send_Message && make clean
	cd Get_Logkey && make clean